package org.jarraiders.musiclibrary.shared.domain;

import java.io.Serializable;
import java.util.UUID;

import org.jarraiders.musiclibrary.domain.Artist;

/**
 * @author AlteroStudio
 */
public class ArtistDTO implements Serializable {

	private static final long serialVersionUID = -1947211500022495591L;

	private String artistId;
	private String artistName;

	public ArtistDTO() {
	}

	private ArtistDTO(String artistName) {
		this.artistId = null;
		this.artistName = artistName;
	}

	/*public ArtistDTO(Artist artist) {
		this.artistId = artist.getArtistId().toString();
		this.artistName = artist.getArtistName();
	}*/

	public static ArtistDTO getNewArtistDTO(String artistName) {
		return new ArtistDTO(artistName);
	}

	public String getArtistName() {
		return artistName;
	}

	public void setArtistName(String artistName) {
		this.artistName = artistName;
	}

	public String getArtistId() {
		return artistId;
	}
	public void setArtistId(String uuid) {
		this.artistId=uuid;
	}

	@Override
	public String toString() {
		StringBuilder builder = new StringBuilder();
		builder.append("ArtistDTO [artistId=");
		builder.append(artistId);
		builder.append(", artistName=");
		builder.append(artistName);
		builder.append("]");
		return builder.toString();
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((artistId == null) ? 0 : artistId.hashCode());
		result = prime * result
				+ ((artistName == null) ? 0 : artistName.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		ArtistDTO other = (ArtistDTO) obj;
		if (artistId == null) {
			if (other.artistId != null)
				return false;
		} else if (!artistId.equals(other.artistId))
			return false;
		if (artistName == null) {
			if (other.artistName != null)
				return false;
		} else if (!artistName.equals(other.artistName))
			return false;
		return true;
	}
}
